<?php

/**
 * Empleado filter form base class.
 *
 * @package    courier
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseEmpleadoFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'emp_nombre'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'emp_apellido' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'emp_login'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'emp_pass'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'emp_perfil'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'emp_ruta'     => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'emp_nombre'   => new sfValidatorPass(array('required' => false)),
      'emp_apellido' => new sfValidatorPass(array('required' => false)),
      'emp_login'    => new sfValidatorPass(array('required' => false)),
      'emp_pass'     => new sfValidatorPass(array('required' => false)),
      'emp_perfil'   => new sfValidatorPass(array('required' => false)),
      'emp_ruta'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('empleado_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Empleado';
  }

  public function getFields()
  {
    return array(
      'emp_id'       => 'Number',
      'emp_nombre'   => 'Text',
      'emp_apellido' => 'Text',
      'emp_login'    => 'Text',
      'emp_pass'     => 'Text',
      'emp_perfil'   => 'Text',
      'emp_ruta'     => 'Number',
    );
  }
}
